/* 页面加载器样式 */

.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    color: #666;
}

.loading-placeholder .loading-spinner {
    text-align: center;
}

.loading-placeholder .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007acc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 错误页面样式 */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    text-align: center;
    padding: 40px;
}

.error-page .error-icon {
    font-size: 4rem;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.error-page h2 {
    color: #333;
    margin-bottom: 10px;
}

.error-page p {
    color: #666;
    margin-bottom: 20px;
}

.error-page .error-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #ff6b6b;
}

.error-page .error-details small {
    color: #666;
    font-family: monospace;
}

/* 页面切换动画 */
.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 应用版本信息样式 - 固定在底部 */
.app-version-footer {
    position: fixed;
    bottom: 0;
    left: 280px;
    right: 0;
    padding: 8px 16px;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.app-version-text {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-weight: 400;
}

.cmd-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 191, 255, 0.1);
    border: 1px solid rgba(0, 191, 255, 0.3);
    border-radius: 6px;
    color: rgba(0, 191, 255, 0.8);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cmd-mode-btn:hover {
    background: rgba(0, 191, 255, 0.2);
    border-color: rgba(0, 191, 255, 0.5);
    color: #00bfff;
    transform: translateY(-1px);
}

.cmd-mode-btn i {
    font-size: 10px;
}

/* 配置页面样式 */
.config-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.config-section {
    background: rgba(26, 32, 46, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.config-section:hover {
    border-color: rgba(0, 191, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 191, 255, 0.1);
}

.config-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #00bfff 0%, #0080ff 100%);
    border-radius: 2px;
}

/* 厂商选择标签 */
.provider-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.provider-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.provider-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #00bfff 0%, #0080ff 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.provider-tab.active::before {
    opacity: 0.1;
}

.provider-tab.active {
    background: rgba(0, 191, 255, 0.1);
    border-color: rgba(0, 191, 255, 0.3);
    color: #00bfff;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.2);
}

.provider-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

.provider-tab i {
    font-size: 16px;
    position: relative;
    z-index: 1;
}

.provider-tab span {
    position: relative;
    z-index: 1;
}

/* 模型选择器 */
.model-selector {
    margin-bottom: 8px;
}

.model-dropdown {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.model-dropdown:focus {
    outline: none;
    border-color: rgba(0, 191, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.1);
}

.model-dropdown option {
    background: #1a202e;
    color: #ffffff;
    padding: 8px;
}

/* API Key 配置 */
.api-key-group {
    margin-bottom: 8px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.api-key-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.api-key-input:focus {
    outline: none;
    border-color: rgba(0, 191, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.1);
}

.api-key-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.btn-register {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 191, 255, 0.1);
    border: 1px solid rgba(0, 191, 255, 0.3);
    border-radius: 12px;
    color: #00bfff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-register:hover {
    background: rgba(0, 191, 255, 0.2);
    border-color: rgba(0, 191, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.2);
}

.api-key-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 12px;
    background: rgba(0, 191, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid rgba(0, 191, 255, 0.3);
}

.api-key-hint i {
    color: rgba(0, 191, 255, 0.8);
}

/* 连接性测试 */
.connection-test-group {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.btn-test-connection {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    color: #22c55e;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-test-connection:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.2);
}

.btn-test-connection:disabled {
    background: rgba(107, 114, 128, 0.1);
    border-color: rgba(107, 114, 128, 0.3);
    color: rgba(107, 114, 128, 0.7);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-test-connection i {
    font-size: 14px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.status-indicator i {
    font-size: 12px;
    transition: all 0.3s ease;
}

.status-indicator.connected i {
    color: #22c55e;
    animation: pulse-green 2s infinite;
}

.status-indicator.disconnected i {
    color: #ef4444;
    animation: pulse-red 2s infinite;
}

.status-indicator.testing i {
    color: #f59e0b;
    animation: spin 1s linear infinite;
}

.status-indicator.unknown i {
    color: #6b7280;
}

.status-text {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
    }
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 配置操作按钮 */
.config-actions {
    text-align: center;
    margin-top: 32px;
}

.btn-save-config {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #00bfff 0%, #0080ff 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.3);
}

.btn-save-config:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 191, 255, 0.4);
}

.btn-save-config:active {
    transform: translateY(0);
}

.btn-save-config i {
    font-size: 16px;
}

/* 应用信息和升级 */
.app-info-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.app-info-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    flex: 1;
    min-width: 200px;
}

.info-item i {
    color: #00bfff;
    font-size: 14px;
}

.info-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
}

.info-value {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.update-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-check-update {
    padding: 12px 24px;
    background: linear-gradient(135deg, #00bfff 0%, #0080ff 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3);
}

.btn-check-update:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.4);
}

.btn-check-update:active {
    transform: translateY(0);
}

.btn-check-update:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.update-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    flex: 1;
}

.update-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
}

.update-indicator i {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
}

.update-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

/* 更新详情 */
.update-details {
    margin-top: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.update-details-content h4 {
    margin: 0 0 16px 0;
    color: #22c55e;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.update-details-content h4 i {
    font-size: 18px;
}

.update-changelog {
    margin: 16px 0;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.update-changelog::-webkit-scrollbar {
    width: 6px;
}

.update-changelog::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.update-changelog::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.update-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn-download-update {
    padding: 10px 20px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.btn-download-update:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-close-update {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-close-update:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .loading-placeholder {
        min-height: 300px;
    }

    .error-page {
        padding: 20px;
    }

    .error-page .error-icon {
        font-size: 3rem;
    }

    .config-container {
        padding: 0 16px;
    }

    .provider-tabs {
        flex-direction: column;
        gap: 8px;
    }

    .provider-tab {
        padding: 14px 16px;
    }

    .input-wrapper {
        flex-direction: column;
        gap: 8px;
    }

    .btn-register {
        justify-content: center;
    }

    .app-info-row {
        flex-direction: column;
        gap: 12px;
    }

    .info-item {
        min-width: 100%;
    }

    .update-section {
        flex-direction: column;
        align-items: stretch;
    }

    .update-actions {
        flex-direction: column;
    }

    .btn-download-update,
    .btn-close-update {
        justify-content: center;
    }
}
